<?php


namespace app\common\lib;


class Show
{
    public static function success($data = [], $message = 'success')
    {
        $res = [
            'code' => config('status.success'),
            'msg' => $message,
            'data' => $data
        ];
        return json($res);
    }

    public static function error($message = 'error', $statusCode = 400, $data = [])
    {
        $res = [
            'code' => config('status.error'),
            'msg' => $message,
            'data' => $data
        ];
        return json($res, $statusCode);
    }
}
